package com.donger.business.upms.service.impl;

import com.donger.business.upms.mapper.SysDictMapper;
import com.donger.common.client.upms.service.RpcDictService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
@Slf4j
public class RpcDictServiceImpl implements RpcDictService {
    private final SysDictMapper sysDictMapper;
    @Override
    @Cacheable(value = "dictTableCache")
    public String queryTableDictTextByKey(String table, String text, String code, String key) {
        log.info("无缓存dictText的时候调用这里！");
        return sysDictMapper.queryTableDictTextByKey(table, text, code, key);
    }

    @Override
    @Cacheable(value = "dictCache")
    public String queryDictTextByKey(String code, String key) {
        log.info("无缓存dictText的时候调用这里！");
        return sysDictMapper.queryDictTextByKey(code, key);
    }
}
